using System.Collections.Generic;
using HCI.Questionaire.Entities;

namespace HCI.Questionaire.QuestionGroup
{
    public abstract class TwoPagesQuestionGroup : QuestionGroupBase
    {
        private int _MaxPage = 1;
        private int PageIndex = 0;

        public override int CurrentQuestionIndex
        {
            get
            {
                return PageIndex;
            }
        }
        public override int NextQuestion()
        {
            if (PageIndex < _MaxPage)
            {
                PageIndex++;
                this.OnQuestionIndexChanged();
                return PageIndex;
            }
            else
                return _MaxPage;
        }

        public override int PreviousQuestion()
        {
            if (PageIndex > 0)
            {
                PageIndex--;
                this.OnQuestionIndexChanged();
                return PageIndex;
            }
            else
                return 0;
        }
        public override bool CanMoveNext
        {
            get
            {
                return this.PageIndex <= 0;
            }
        }

        public override bool CanMovePrevious
        {
            get
            {
                return this.PageIndex >= 1;
            }
        }

        public override abstract int GroupIndex { get; }
       
    }
}
